﻿using System.Linq;
using NTTDATA.BEENChina.ResultCertification.Result;
using NTTDATA.BEENChina.ResultCertification.Split;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using NTTDATA.BEENChina.ResultCertification.Config;
using System.Collections.Generic;

namespace NTTDATA.BEENChina.ResultCertification.Test.Split
{
    
    
    /// <summary>
    ///这是 SplitResultTest_ 的测试类，旨在
    ///包含所有 SplitResultTest_ 单元测试
    ///</summary>
    [TestClass()]
    public class SplitResultTest_
    {


        private TestContext testContextInstance;

        /// <summary>
        ///获取或设置测试上下文，上下文提供
        ///有关当前测试运行及其功能的信息。
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region 附加测试特性
        // 
        //编写测试时，还可使用以下特性:
        //
        //使用 ClassInitialize 在运行类中的第一个测试前先运行代码
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //使用 ClassCleanup 在运行完类中的所有测试后再运行代码
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //使用 TestInitialize 在运行每个测试前先运行代码
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //使用 TestCleanup 在运行完每个测试后运行代码
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        [TestMethod()]
        public void GetSplitResultTest_0()
        {
       /*     string[] fruits = { "apple", "banana", "mango", "orange", 
                                  "passionfruit", "grape" };

            IEnumerable<string> query =
                fruits.SkipWhile(fruit => String.Compare("orange", fruit, true) == 0);

            foreach (string fruit in query)
            {
                Console.WriteLine(fruit);
            }*/

            int[] grades = { 59, 82, 70, 56, 92, 98, 85 };

            IEnumerable<int> lowerGrades =
                grades
                 .OrderByDescending(grade => grade)
                .SkipWhile(grade => grade >= 80);

            Console.WriteLine("All grades below 80:");
            foreach (int grade in lowerGrades)
            {
                Console.WriteLine(grade);
            }



        }

        /// <summary>
        ///GetSplitResult 的测试
        ///</summary>
        [TestMethod()]
        public void GetSplitResultTest_1()
        {
            CategoryConfig categoryConfig = new DataStore.CategoryConfigAccess().GetCagetoryConfig("95710620 ");
                
           
            SplitResult target = new SplitResult(categoryConfig); // TODO: 初始化为适当的值
            string entryResult = @"/2013/10/28///2013/10/3"; // TODO: 初始化为适当的值

            List<List<string>> expected = null; // TODO: 初始化为适当的值
            List<List<string>> actual;
            actual = target.GetSplitResult(entryResult);

            Assert.IsTrue(actual.Count == 2);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }

        /// <summary>
        ///GetSplitResult 的测试
        ///</summary>
        [TestMethod()]
        public void GetSplitResultTest_2()
        {
            CategoryConfig categoryConfig = new DataStore.CategoryConfigAccess().GetCagetoryConfig("94000500");
           

            SplitResult target = new SplitResult(categoryConfig); // TODO: 初始化为适当的值


            string entryResult = "4/25/7/18//4/25/4/2/\\/////////"; // TODO: 初始化为适当的值

            List<List<string>> expected = null; // TODO: 初始化为适当的值
            List<List<string>> actual;
            actual = target.GetSplitResult(entryResult);

            Assert.IsTrue(actual.Count == 2);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
    }
}
